package nix.jdbc;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.dbcp.BasicDataSource;
import org.junit.Test;

public class Test3 {

	@Test
	public void fun1() throws SQLException {
		
		BasicDataSource dataSource = new BasicDataSource();
		dataSource.setDriverClassName("com.mysql.jdbc.Driver");
		dataSource.setUrl("jdbc:mysql://localhost:3306/test");
		dataSource.setUsername("root");
		dataSource.setPassword("race");
		
		dataSource.setMaxActive(20);
		dataSource.setMinIdle(3);
		dataSource.setMaxWait(1000);
		
		Connection con = dataSource.getConnection();
		ConnectionWrapper con2 = new ConnectionWrapper(con);
		con2.close();
		
		System.out.println(con.getClass().getName());		
		System.out.println(con2.getClass().getName());
	}
}
